package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.Task;
import com.bxj.wxtt.mapper.master.TaskMasterMapper;
import com.bxj.wxtt.mapper.slave.TaskSlaveMapper;
import com.bxj.wxtt.service.TaskService;
import com.ifeng.matrix.common.domain.PageResult;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 19:49:05
 */
@Component("taskService")
public class TaskServiceImpl implements TaskService {
    @Resource
    TaskMasterMapper taskMasterMapper;

    @Resource
    TaskSlaveMapper taskSlaveMapper;

    public List<Task> getTaskList(Task task) {
        return taskSlaveMapper.getTaskList(task);
    }

    public Task selectById(Integer id) {
        return taskSlaveMapper.selectById(id);
    }

    public PageResult<Task> getTaskPage(Task task) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(taskSlaveMapper.countSeletive(task));
        pageResult.setResult(taskSlaveMapper.getTaskList(task));
        return pageResult;
    }

    public int insert(Task task) {
        return taskMasterMapper.insert(task);
    }

    public int deleteTaskById(Integer id) {
        return taskMasterMapper.deleteTaskById(id);
    }

    public int updateTaskById(Task task) {
        return taskMasterMapper.updateTaskById(task);
    }
}